package com.example.confessionwall.service;

import com.example.confessionwall.mapper.MessageMapper;
import com.example.confessionwall.model.Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class MessageService {
    @Autowired
    MessageMapper messageMapper;
    public void setMessage(Message message){
        messageMapper.insertMessage(message);
    }

    public List<Message> selectAll(){
        List<Message> res = messageMapper.selectAll();
        log.info(res.toString());
        return res;
    }
}
